INCLUDE = /usr/lib/jvm/java-6-sun-1.6.0.26/include

all : MyProgram.class libhello.so

Greet.class : Greet.java
	javac Greet.java

Greet.h : Greet.java
	javah -jni Greet

MyProgram.class : MyProgram.java
	javac MyProgram.java

libhello.so : Greet.h hello.cpp
	g++ -shared -fpic -I $(INCLUDE) -I $(INCLUDE)/linux -o libhello.so hello.cpp

clean:
	rm -f *.class Greet.h *.so

test:
	java -Djava.library.path=. MyProgram
